<template>
  <el-dialog
    :title="title"
    :visible.sync="visible"
    :before-close="closeDlg"
    :close-on-click-modal="false"
    destroy-on-close="true"
    style="margin-top: -60px"
    :width="width"
  >
    <div :style="'width: 100%; height: ' + height + ';'" class="scrollbar">
      <el-scrollbar style="height: 100%;">
        <el-table
          v-loading="listLoading"
          :data="list"
          border
          fit
          highlight-current-row
          style="width: 100%;"
        >
          <!--    列表内容-->
<!--          <el-table-column v-if="pagePrivilege!==null" type="selection" width="40"></el-table-column>-->
<!--          <el-table-column v-if="pagePrivilege!==null" label="名称" width="" align="" show-overflow-tooltip>-->
<!--            <template slot-scope="{row}">-->
<!--              <span>{{ row.name }}</span>-->
<!--            </template>-->
<!--          </el-table-column>-->
          <el-table-column label="任务定义" width="" align="" show-overflow-tooltip>
            <template slot-scope="{row}">
              <span>{{ row.taskDefine_name }}</span>
            </template>
          </el-table-column>

          <el-table-column :label="$t('table.actions')" align="" width="50" class-name="small-padding fixed-width">
            <template slot-scope="{row}">
              <!--                <el-button type="primary" size="mini" @click="handleUpdate(row)">-->
              <!--                  {{ $t('table.edit') }}-->
              <!--                </el-button>-->
<!--              <el-button size="mini" type="danger" @click="handleDelete(row)">-->
<!--                {{ $t('table.delete') }}-->
<!--              </el-button>-->
              <img
                @click="handleDelete(row)"
                title="删除"
                :src="listIcon.delete"
                alt=""
                class="listIcon"
              />
            </template>
          </el-table-column>
        </el-table>
      </el-scrollbar>
    </div>
    <!--    分页-->
<!--    <pagination v-show="total>0" :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageNumber" @pagination="getUserList" />-->

    <br><br>
    <span class="el-dialog__title">添加任务</span>
    <div style="width: 100%; height: 250px; padding-top: 20px; margin-top: 30px; border: 1px solid #dfe6ec" class="scrollbar">
      <el-scrollbar style="height: 100%;">
        <el-form ref="dataForm" :rules="rules" :model="temp" label-position="right" label-width="120px" style="margin-left:0px;">
          <el-row>
            <el-col :span="6">
              <el-form-item label="任务定义" prop="taskDefineID">
                <el-select
                  v-model="temp.taskDefineID"
                  @click.native="LoadTaskDefinenList"
                  class="filter-item"
                  clearable
                  filterable
                  placeholder="请选择任务定义"
                  style="width: 160px;"
                >
                  <el-option v-for="item in taskDefineList" :key="item.ID" :label="item.name" :value="item.ID" />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="卫星转发器" prop="transponderID">
                <el-select
                  v-model="temp.transponderID"
                  @click.native="LoadTransponderList"
                  ref="transponderID"
                  class="filter-item"
                  placeholder="卫星转发器"
                  style="width: 160px;"
                >
                  <el-option v-for="item in transponderList" :key="item.ID" :label="item.name" :value="item.ID" />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <!--            -->
              <el-form-item label="卫星天线" prop="antennaID">
                <el-select
                  v-model="temp.antennaID"
                  ref="antennaID"
                  class="filter-item"
                  placeholder="卫星天线"
                  style="width: 160px;"
                >
                  <el-option v-for="item in antennaList" :key="item.ID" :label="item.name" :value="item.ID" />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <!--            -->
              <el-form-item label="卫星放大器" prop="amplifierID">
                <el-select
                  v-model="temp.amplifierID"
                  ref="amplifierID"
                  class="filter-item"
                  placeholder="卫星放大器"
                  style="width: 160px;"
                >
                  <el-option v-for="item in amplifierList" :key="item.ID" :label="item.name" :value="item.ID" />
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row>
            <el-col :span="6">
              <!--            -->
              <el-form-item label="卫星接收机" prop="receiverID">
                <el-select
                  v-model="temp.receiverID"
                  ref="receiverID"
                  class="filter-item"
                  placeholder="卫星接收机"
                  style="width: 160px;"
                >
                  <el-option v-for="item in receiverList" :key="item.ID" :label="item.name" :value="item.ID" />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <!--            -->
              <el-form-item label="卫星信标" prop="beaconID">
                <el-select
                  v-model="temp.beaconID"
                  ref="beaconID"
                  class="filter-item"
                  placeholder="卫星信标"
                  style="width: 160px;"
                >
                  <el-option v-for="item in beaconList" :key="item.ID" :label="item.name" :value="item.ID" />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <!--            -->
              <el-form-item label="发射地面站" prop="sendStationID">
                <el-select
                  v-model="temp.sendStationID"
                  ref="sendStationID"
                  class="filter-item"
                  @change="makeChainListBySendStationID"
                  placeholder="发射地面站"
                  style="width: 160px;"
                >
                  <el-option v-for="item in sendStationList" :key="item.ID" :label="item.name" :value="item.ID" />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <!--            -->
              <el-form-item label="发射链路" prop="sendChainID">
                <el-select
                  v-model="temp.sendChainID"
                  ref="sendChainID"
                  class="filter-item"
                  placeholder="发射链路"
                  style="width: 160px;"
                >
                  <el-option v-for="item in sendChainList" :key="item.ID" :label="item.name" :value="item.ID" />
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row>
            <el-col :span="6">
              <!--            -->
              <el-form-item label="回传链路" prop="sendReceiveChainID">
                <el-select
                  v-model="temp.sendReceiveChainID"
                  ref="sendReceiveChainID"
                  class="filter-item"
                  placeholder="回传链路"
                  style="width: 160px;"
                >
                  <el-option v-for="item in sendReceiveChainList" :key="item.ID" :label="item.name" :value="item.ID" />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <!--            -->
              <el-form-item label="接收地面站" prop="receiveStationID">
                <el-select
                  v-model="temp.receiveStationID"
                  ref="receiveStationID"
                  class="filter-item"
                  placeholder="接收地面站"
                  @change="makeChainListByReceiveStationID"
                  style="width: 160px;"
                >
                  <el-option v-for="item in receiveStationList" :key="item.ID" :label="item.name" :value="item.ID" />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <!--            -->
              <el-form-item label="注入链路" prop="receiveSendChainID">
                <el-select
                  v-model="temp.receiveSendChainID"
                  ref="receiveSendChainID"
                  class="filter-item"
                  placeholder="注入链路"
                  style="width: 160px;"
                >
                  <el-option v-for="item in receiveSendChainList" :key="item.ID" :label="item.name" :value="item.ID" />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <!--            -->
              <el-form-item label="接收链路" prop="receiveChainID">
                <el-select
                  v-model="temp.receiveChainID"
                  ref="receiveChainID"
                  class="filter-item"
                  placeholder="接收链路"
                  style="width: 160px;"
                >
                  <el-option v-for="item in receiveChainList" :key="item.ID" :label="item.name" :value="item.ID" />
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row>
            <el-col :span="6">
              <!---->
              <el-form-item label="发射信号源仪器1" prop="transmitSignalInstrument1ID">
                <el-select
                  v-model="temp.transmitSignalInstrument1ID"
                  ref="receiveChainID"
                  class="filter-item"
                  placeholder="发射信号源仪器1"
                  style="width: 160px;"
                >
                  <el-option v-for="item in transmitSignalInstrument1List" :key="item.ID" :label="item.name" :value="item.ID" />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <!---->
              <el-form-item label="发射信号源仪器2" prop="transmitSignalInstrument2ID">
                <el-select
                  v-model="temp.transmitSignalInstrument2ID"
                  ref="receiveChainID"
                  class="filter-item"
                  placeholder="发射信号源仪器2"
                  style="width: 160px;"
                >
                  <el-option v-for="item in transmitSignalInstrument2List" :key="item.ID" :label="item.name" :value="item.ID" />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <!---->
              <el-form-item label="注入信号源仪器" prop="injectSignalInstrumentID">
                <el-select
                  v-model="temp.injectSignalInstrumentID"
                  ref="receiveChainID"
                  class="filter-item"
                  placeholder="注入信号源仪器"
                  style="width: 160px;"
                >
                  <el-option v-for="item in injectSignalInstrumentList" :key="item.ID" :label="item.name" :value="item.ID" />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <!---->
              <el-form-item label="发射频谱仪仪器" prop="transmitSpectrumInstrumentID">
                <el-select
                  v-model="temp.transmitSpectrumInstrumentID"
                  ref="receiveChainID"
                  class="filter-item"
                  placeholder="发射频谱仪仪器"
                  style="width: 160px;"
                >
                  <el-option v-for="item in transmitSpectrumInstrumentList" :key="item.ID" :label="item.name" :value="item.ID" />
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row>
            <el-col :span="6">
              <!---->
              <el-form-item label="接收频谱仪仪器1" prop="receiveSpectrumInstrument1ID">
                <el-select
                  v-model="temp.receiveSpectrumInstrument1ID"
                  ref="receiveChainID"
                  class="filter-item"
                  placeholder="接收频谱仪仪器1"
                  style="width: 160px;"
                >
                  <el-option v-for="item in receiveSpectrumInstrument1List" :key="item.ID" :label="item.name" :value="item.ID" />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <!---->
              <el-form-item label="接收频谱仪仪器2" prop="receiveSpectrumInstrument2ID">
                <el-select
                  v-model="temp.receiveSpectrumInstrument2ID"
                  ref="receiveChainID"
                  class="filter-item"
                  placeholder="接收频谱仪仪器2"
                  style="width: 160px;"
                >
                  <el-option v-for="item in receiveSpectrumInstrument2List" :key="item.ID" :label="item.name" :value="item.ID" />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <!---->
              <el-form-item label="发射功率计仪器" prop="transmitPowerInstrumentID">
                <el-select
                  v-model="temp.transmitPowerInstrumentID"
                  ref="receiveChainID"
                  class="filter-item"
                  placeholder="发射功率计仪器"
                  style="width: 160px;"
                >
                  <el-option v-for="item in transmitPowerInstrumentList" :key="item.ID" :label="item.name" :value="item.ID" />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <!---->
              <el-form-item label="发射功率计通道" prop="transmitPowerChannel">
                <el-select
                  v-model="temp.transmitPowerChannel"
                  ref="receiveChainID"
                  class="filter-item"
                  placeholder="发射功率计通道"
                  style="width: 160px;"
                >
                  <el-option v-for="item in transmitPowerChannelList" :key="item.ID" :label="item.name" :value="item.ID" />
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row>
            <el-col :span="6">
              <!---->
              <el-form-item label="接收功率计仪器" prop="receivePowerInstrumentID">
                <el-select
                  v-model="temp.receivePowerInstrumentID"
                  ref="receiveChainID"
                  class="filter-item"
                  placeholder="接收功率计仪器"
                  style="width: 160px;"
                >
                  <el-option v-for="item in receivePowerInstrumentList" :key="item.ID" :label="item.name" :value="item.ID" />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <!--            -->
              <el-form-item label="接收功率计通道" prop="receivePowerChannel">
                <el-select
                  v-model="temp.receivePowerChannel"
                  ref="receiveChainID"
                  class="filter-item"
                  placeholder="接收功率计通道"
                  style="width: 160px;"
                >
                  <el-option v-for="item in receivePowerChannelList" :key="item.ID" :label="item.name" :value="item.ID" />
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>

          <div style="float: right;margin-bottom: 10px;margin-right: 40px;">
<!--            <el-button @click="dialogFormVisible = false">-->
<!--              {{ $t('table.cancel') }}-->
<!--            </el-button>-->
            <el-button type="primary" @click="createData">
              添加
            </el-button>
          </div>
        </el-form>
      </el-scrollbar>
    </div>
    <!--    对话框下方按钮-->
    <div slot="footer" class="dialog-footer">
      <!--    取消按钮-->
<!--      <el-button @click="closeDlg">-->
<!--        {{ $t('table.cancel') }}-->
<!--      </el-button>-->

      <!--    提交按钮-->
      <el-button type="primary" @click="closeDlg">
        关闭
      </el-button>
    </div>
  </el-dialog>
</template>

<script>
import { controlAmount, isNotEmpty, zEnBase64 } from '@/utils'
import { getToken } from '@/utils/auth'
import global from '@/common'
import { createTaskPlanItem, deleteTaskPlanItem } from '@/api/weixing/taskPlanItem'
import { getTaskDefineList } from '@/api/weixing/base'
import { getTaskPlanItemList } from '@/api/weixing/base'
import { fetchTaskDefineOne } from '@/api/weixing/taskDefine'

export default {
  name: 'TaskPlanItem',
  props: {
    width: {
      type: String,
      default: '1200px'
    },
    height: {
      type: String,
      default: '300px'
    },
    visible: {
      type: Boolean,
      default: false
    },
    title: {
      type: String,
      default: '任务列表'
    },
    row: {
      type: Object,
      default: null
    }
  },
  data() {
    return {
      list: null, // 列表数据
      listLoading: true, // 列表状态为加载中
      loadingBtn: false, // 防止表单重复提交
      loadingBtnTitle: '确定', // 提交按钮标题
      listIcon: global.listIcon, // 列表按钮图标
      taskDefineList: [],
      transponderList: [],
      rules: {
        taskDefineID: [{ required: true, message: '任务定义不能为空', trigger: 'blur' }]
      },
      temp: {
        taskDefineID: '',
        transponderID: '',
        antennaID: '',
        amplifierID: '',
        receiverID: '',
        beaconID: '',
        sendStationID: '',
        sendChainID: '',
        sendReceiveChainID: '',
        receiveStationID: '',
        receiveSendChainID: '',
        receiveChainID: '',
        transmitSignalInstrument1ID: '',
        transmitSignalInstrument2ID: '',
        injectSignalInstrumentID: '',
        transmitSpectrumInstrumentID: '',
        receiveSpectrumInstrument1ID: '',
        receiveSpectrumInstrument2ID: '',
        transmitPowerInstrumentID: '',
        transmitPowerChannel: '',
        receivePowerInstrumentID: '',
        receivePowerChannel: ''
      }
    }
  },
  created() {
    console.log(this.row)
    this.getList()
  },
  methods: {
    LoadTaskDefinenList() {
      getTaskDefineList(
        'applicationID=' + this.row.applicationID +
        ',organizationID=' + this.row.organizationID +
        ',projectID=' + this.row.projectID
      ).then(response => {
        this.taskDefineList = response.body.data.rows
      })
    },
    // 加载列表
    getList() {
      this.listLoading = true
      getTaskPlanItemList('applicationID=' + this.$store.state.user.info.applicationID +
        ',organizationID=' + this.$store.state.user.info.organizationID +
        ',taskPlanID=' + this.row.ID,'taskDefine.taskDefineID.name').then((response) => {
        this.list = response.body.data.rows
        this.listLoading = false
      })
    },
    // 创建
    createData() {
      this.$refs['dataForm'].validate((valid) => {
        if (valid) {
          this.loadingBtn = true // 提交按钮不可用
          this.loadingBtnTitle = '提交中...'
          let params = ''
          params += 'applicationID=' + zEnBase64(this.row.applicationID)
          params += ',organizationID=' + zEnBase64(this.row.organizationID)
          if (isNotEmpty(this.row.customerOrganizationID)) { params += ',customerOrganizationID=' + zEnBase64(this.row.customerOrganizationID) }
          if (isNotEmpty(this.row.satelliteID)) { params += ',satelliteID=' + zEnBase64(this.row.satelliteID) }
          if (isNotEmpty(this.row.projectID)) { params += ',projectID=' + zEnBase64(this.row.projectID) }
          if (isNotEmpty(this.row.stationID)) { params += ',stationID=' + zEnBase64(this.row.stationID) }
          if (isNotEmpty(this.row.ID)) { params += ',taskPlanID=' + zEnBase64(this.row.ID) }
          if (isNotEmpty(this.row.name)) { params += ',shortName=' + zEnBase64(this.row.name) }
          if (isNotEmpty(this.row.orderSeq)) { params += ',orderSeq=' + zEnBase64(this.row.orderSeq) }
          if (isNotEmpty(this.temp.transponderID)) { params += ',transponderID=' + zEnBase64(this.temp.transponderID) }
          if (isNotEmpty(this.temp.antennaID)) { params += ',antennaID=' + zEnBase64(this.temp.antennaID) }
          if (isNotEmpty(this.temp.amplifierID)) { params += ',amplifierID=' + zEnBase64(this.temp.amplifierID) }
          if (isNotEmpty(this.temp.receiverID)) { params += ',receiverID=' + zEnBase64(this.temp.receiverID) }
          if (isNotEmpty(this.temp.beaconID)) { params += ',beaconID=' + zEnBase64(this.temp.beaconID) }
          if (isNotEmpty(this.temp.sendStationID)) { params += ',sendStationID=' + zEnBase64(this.temp.sendStationID) }
          if (isNotEmpty(this.temp.sendChainID)) { params += ',sendChainID=' + zEnBase64(this.temp.sendChainID) }
          if (isNotEmpty(this.temp.sendReceiveChainID)) { params += ',sendReceiveChainID=' + zEnBase64(this.temp.sendReceiveChainID) }
          if (isNotEmpty(this.temp.receiveStationID)) { params += ',receiveStationID=' + zEnBase64(this.temp.receiveStationID) }
          if (isNotEmpty(this.temp.receiveSendChainID)) { params += ',receiveSendChainID=' + zEnBase64(this.temp.receiveSendChainID) }
          if (isNotEmpty(this.temp.receiveChainID)) { params += ',receiveChainID=' + zEnBase64(this.temp.receiveChainID) }
          if (isNotEmpty(this.temp.transmitSignalInstrument1ID)) { params += ',transmitSignalInstrument1ID=' + zEnBase64(this.temp.transmitSignalInstrument1ID) }
          if (isNotEmpty(this.temp.transmitSignalInstrument2ID)) { params += ',transmitSignalInstrument2ID=' + zEnBase64(this.temp.transmitSignalInstrument2ID) }
          if (isNotEmpty(this.temp.injectSignalInstrumentID)) { params += ',injectSignalInstrumentID=' + zEnBase64(this.temp.injectSignalInstrumentID) }
          if (isNotEmpty(this.temp.transmitSpectrumInstrumentID)) { params += ',transmitSpectrumInstrumentID=' + zEnBase64(this.temp.transmitSpectrumInstrumentID) }
          if (isNotEmpty(this.temp.receiveSpectrumInstrument1ID)) { params += ',receiveSpectrumInstrument1ID=' + zEnBase64(this.temp.receiveSpectrumInstrument1ID) }
          if (isNotEmpty(this.temp.receiveSpectrumInstrument2ID)) { params += ',receiveSpectrumInstrument2ID=' + zEnBase64(this.temp.receiveSpectrumInstrument2ID) }
          if (isNotEmpty(this.temp.transmitPowerInstrumentID)) { params += ',transmitPowerInstrumentID=' + zEnBase64(this.temp.transmitPowerInstrumentID) }
          if (isNotEmpty(this.temp.transmitPowerChannel)) { params += ',transmitPowerChannel=' + zEnBase64(this.temp.transmitPowerChannel) }
          if (isNotEmpty(this.temp.receivePowerInstrumentID)) { params += ',receivePowerInstrumentID=' + zEnBase64(this.temp.receivePowerInstrumentID) }
          if (isNotEmpty(this.temp.receivePowerChannel)) { params += ',receivePowerChannel=' + zEnBase64(this.temp.receivePowerChannel) }
          params += ',taskDefineID=' + zEnBase64(this.temp.taskDefineID)
          fetchTaskDefineOne({ token: getToken(), ID: this.temp.taskDefineID }).then(response => {
            params += ',name=' + zEnBase64(response.body.data.name)
            const data = { token: getToken(), parameterArray: params, functionID: global.functionID }
            createTaskPlanItem(data).then(response => {
              if (response.header.code === 0) {
                this.getList()
                this.dialogFormVisible = false // 关闭对话框
                // this.$notify({ title: '创建成功', message: this.temp.name, type: 'success', duration: global.notify.durationShort })
                this.temp.taskDefineID = ''
              } else {
                this.loadingBtn = false // 提交按钮可用
                this.loadingBtnTitle = '确定'
                this.$notify({ title: '创建失败', message: response.header.msg, type: 'error', duration: global.notify.duration })
              }
            }).catch(err => {
              this.loadingBtn = false // 提交按钮可用
              this.loadingBtnTitle = '确定'
              console.error(err)
            })
          })
        }
      })
    },
    // 删除
    handleDelete(row) {
      this.$confirm('是否确认删除 ' + row.name + '?', {
        type: 'warning',
        closeOnClickModal: false, // 点击区域外不可关闭
        closeOnPressEscape: false // 按ESC不可关闭
      }).then(() => {
        const params = { token: getToken(), parameterArray: 'ID=' + row.ID, functionID: global.functionID }
        deleteTaskPlanItem(params).then(response => {
          if (response.header.code === 0) {
            this.getList()
            // this.$notify({ title: '删除成功', message: row.name, type: 'success', duration: global.notify.durationShort })
          } else {
            this.$notify({ title: '删除失败', message: response.header.msg, type: 'error', duration: global.notify.duration })
          }
        }).catch(err => {
          console.error(err)
        })
      })
    },
    // 编辑
    // updateData() {
    //   this.$refs['dataForm'].validate((valid) => {
    //     if (valid) {
    //       this.loadingBtn = true // 提交按钮不可用
    //       this.loadingBtnTitle = '提交中...'
    //       let params = ''
    //       params += 'ID=' + this.temp.ID
    //       params += ',applicationID=' + zEnBase64(this.$store.state.user.info.applicationID)
    //       params += ',organizationID=' + zEnBase64(this.$store.state.user.info.organizationID)
    //       if (isNotEmpty(this.temp.customerOrganizationID)) { params += ',customerOrganizationID=' + zEnBase64(this.temp.customerOrganizationID) }
    //       if (isNotEmpty(this.temp.satelliteID)) { params += ',satelliteID=' + zEnBase64(this.temp.satelliteID) }
    //       if (isNotEmpty(this.temp.projectID)) { params += ',projectID=' + zEnBase64(this.temp.projectID) }
    //       if (isNotEmpty(this.temp.stationID)) { params += ',stationID=' + zEnBase64(this.temp.stationID) }
    //       if (isNotEmpty(this.temp.taskPlanID)) { params += ',taskPlanID=' + zEnBase64(this.temp.taskPlanID) }
    //       if (isNotEmpty(this.temp.name)) { params += ',name=' + zEnBase64(this.temp.name) }
    //       if (isNotEmpty(this.temp.orderSeq)) { params += ',orderSeq=' + zEnBase64(this.temp.orderSeq) }
    //       if (isNotEmpty(this.temp.taskDefineID)) { params += ',taskDefineID=' + zEnBase64(this.temp.taskDefineID) }
    //       const data = { token: getToken(), parameterArray: params, functionID: global.functionID }
    //       updateTaskPlanItem(data).then(response => {
    //         if (response.header.code === 0) {
    //           this.getList()
    //           this.dialogFormVisible = false
    //           this.$notify({ title: '更新成功', message: this.temp.name, type: 'success', duration: global.notify.durationShort })
    //         } else {
    //           this.loadingBtn = false // 提交按钮可用
    //           this.loadingBtnTitle = '确定'
    //           this.$notify({ title: '更新失败', message: response.header.msg, type: 'error', duration: global.notify.duration })
    //         }
    //       }).catch(err => {
    //         this.loadingBtn = false // 提交按钮可用
    //         this.loadingBtnTitle = '确定'
    //         console.error(err)
    //       })
    //     }
    //   })
    // },
    closeDlg() {
      this.visible = false
      this.$parent.taskPlanItemVisible = false
    },
    common_event(event_name, index) {
      if (isNotEmpty(event_name)) {
        this[event_name](index)
      }
    },
    makeFrequency(index) {
      this.$nextTick(() => {
        this.inputList[index].value = controlAmount(this.inputList[index].value)
      })
    }
  }
}
</script>

<style>
  .el-scrollbar__wrap {
    overflow-x: hidden;
  }
</style>
